package com.gym.code.generator.model.mapping.bean;

import java.util.ArrayList;
import java.util.List;

import com.gym.code.generator.model.mapping.BaseGenerateModel;
import com.gym.code.generator.model.mapping.field.FieldGenerateModel;
import com.gym.code.generator.utils.LocalStringUtils;

/**
 * 
 * @author xinchun.wang
 * @email: 532002108@qq.com
 * @createTime 2015-4-11 下午12:21:14
 */

public class BeanGenerateModel extends BaseGenerateModel {
	private String beanName;
	private String tableName;

	private String desc;

	private List<FieldGenerateModel> columnProperyMappingList;

	public String getBeanName() {
		return beanName;
	}
	
	
	public String getBeanNameByFirstLetterUpper() {
		return LocalStringUtils.toFirstLetterUpper(beanName);
	}

	public void setBeanName(String beanName) {
		this.beanName = beanName;
	}

	public List<FieldGenerateModel> getColumnProperyMappingList() {
		if (columnProperyMappingList == null) {
			columnProperyMappingList = new ArrayList<FieldGenerateModel>();
		}
		return columnProperyMappingList;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	@Override
	protected String getFileName() {
		return  beanName;
	}

	@Override
	public String getPackageName() {
		return packagePath  + ".bean";
	}

}